﻿using System;

using Holdem.Core.Entities.StartingHands;
using Holdem.Core.Statistics;
using Holdem.Interfaces.Configuration;
using Holdem.Interfaces.Service;

namespace Holdem.ViewModel
{
	public abstract class HoldemViewModelCommandBase : HoldemViewModelVisibilityBase
	{
		#region Instance Variables

		private readonly IConfigurationService _configService;
        private readonly IntRangeDataSource _playersData;

		#endregion //Instance Variables

		#region Public Properties

        public IntRangeDataSource PlayersData
        {
            get
            {
                return _playersData;
            }
        }

		#endregion //Public Properties

		#region Protected Properties

		protected IHoldemConfiguration<ConfigKey, object> PersistConfig
		{
			get
			{
				return _configService.PersistentConfiguration;
			}
		}
		
		#endregion //Protected Properties

		#region Constructor

		protected HoldemViewModelCommandBase(IConfigurationService configService)
		{
			if (configService == null)
				throw new ArgumentNullException("configService");

			_configService = configService;

            
            _playersData = new IntRangeDataSource(2, HoldemStatisticsBase.MaxPlayers);
		}

		#endregion //Constructor
	}
}